import request from "@/utils/request";

// 创建商品分类
export function createCategory(data) {
  return request({
    url: "/store/category/create",
    method: "post",
    data: data,
  });
}

// 更新商品分类
export function updateCategory(data) {
  return request({
    url: "/store/category/update",
    method: "put",
    data: data,
  });
}

// 删除商品分类
export function deleteCategory(id) {
  return request({
    url: "/store/category/delete?id=" + id,
    method: "delete",
  });
}

// 获得商品分类
export function getCategory(id) {
  return request({
    url: "/store/category/get?id=" + id,
    method: "get",
  });
}

// 获得商品分类列表
export function getCategoryList(params) {
  return request({
    url: "/store/category/list",
    method: "get",
    params,
  });
}
// 导出商品分类 Excel
export function exportCategoryExcel(params) {
  return request({
    url: "/store/category/export-excel",
    method: "get",
    params,
    responseType: "blob",
  });
}
